Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes live tail memory usage by introducing a cache page limit for live data and by pausing live updates when the document is not visible.
- Added a new maxPages parameter to limit the cache in live data scenarios.
- Integrated document visibility checks to prevent unnecessary live updates when the user’s tab is inactive.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/app/src/hooks/useOffsetPaginatedQuery.tsx | Added a maxPages setting to aggressively limit cached pages for live data. |
| packages/app/src/DBSearchPage.tsx | Introduced document visibility checks to pause live updates when the tab is hidden. |
Comments suppressed due to low confidence (2)
packages/app/src/hooks/useOffsetPaginatedQuery.tsx:306
- Consider adding tests to verify that the maxPages option effectively limits the cached pages for live data scenarios.
maxPages: isLive ? 5 : undefined, // Limit number of pages kept in cache for live data
packages/app/src/DBSearchPage.tsx:809
- Consider adding tests to verify that live updates pause correctly when the document is not visible.
const isTabVisible = useDocumentVisibility();
|
This PR solves the issue with the amount of data we cache + pausing live tail when the tab isn't visible/active. There are other legit memory leaks/issues that are attached to the ticket that I will spawn off as lower pri in the backlog. |
No description provided.